# -*- coding: utf-8 -*-



def dec(req, tpl, static, variables):
    '''
    Getting declination
    '''
    
    vars = []
    count = False
    
    #Collection uniq data
    for key, value in variables.items():
        vars.append(value)
    
    #if there is not vars
    if vars:
        count = int( vars[0] )
        
    else:
        if len(static) == 4:
            count = int( static[0] )
            del static[0]
    
    
    def getWordFormForCount( count ):
        count = count % 100
        c10 = count % 10
        if c10 == 0 or c10 >= 5 or ( count > 5 and count < 21 ): return 0
        if c10 == 1: return 1
        return 2
   
    if isinstance(count, int):       
        return str(count)  + ' ' + static[ getWordFormForCount(count) ]
    else:
        return ''

